<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
include_once("../modelo/ModeloRanking.php");
include_once("../control/ControlRanking.php");
$cRanking = new ControlRanking();
//Esto nos ha guardado los datos en las variables de sesion
$cRanking->getlistaRanking();

$arRanking = $_SESSION['arRanking'];
?>
<script type="text/javascript"  lang="javascript" >
    $(document).ready( function () {
        var oTable = $('#tablaRanking').dataTable( {
            "sDom": 'R<"H"lfr>t<"F"ip>',
            "bJQueryUI": true,
            "sPaginationType": "full_numbers",
            "bPaginate": true,
            "bLengthChange": true,
            "bFilter": true,
            "bSort": false,
            "bInfo": true,
            "bAutoWidth": true
        } );
    } );

    
</script>
<div>
    <h3>
        Ranking
    </h3>
    
<br />
    <div id="divtablaPostulados">
        <table id="tablaRanking" class="tabla_datos">
            <thead>
                <tr>
                    <th scope="col">Torneo</th>
                    <th scope="col">Modalidad</th>
                    <th scope="col">Categoria</th>
                    <th scope="col">N. Jugadores</th>
                    <th scope="col">opcion</th>
                </tr>
            </thead>
            <tbody>
                <?php
                foreach ($arRanking as $oRanking) {
                    ?>
                    <tr>
                        <td><?php echo $oRanking->idtorneo ?></td>
                        <td><?php echo $oRanking->modnombre ?></td>
                        <td><?php echo $oRanking->catnombre  ?></td>
                        <td><?php echo $oRanking->jugadores ?></td>
                        <td id="tdopcion">                
                            <a href="../vista/Ranking.php?op=ver&id=<?php echo $oRanking->idranking ?>">
                                <img src="../css/images/buscar.png" border="0" alt="verRanking" title="verRanking" />
                            </a>
                        </td>
                    </tr>
                    <?php
                }
                ?> 
            </tbody>
        </table>
    </div>
</div>